<template>
	<!-- 价格说明 -->
	<view class="box p20">
		
		<view class="df aic jcsb">
			
			<view class="u-line-2 title df aic fs30" style="width: 500rpx">
				<view class="supplier-type" v-if="!info.platformGoodsSpecMix[0].supplierName" :class="[!info.platformGoodsSpecMix[0].supplierName ? 'zy-class' : 'pop-class']">
					{{ info.platformGoodsSpecMix[0].supplierName ? info.platformGoodsSpecMix[0].supplierName : "自营" }}
				</view>
				{{ info.customGoodsName || "" }}
			</view>
			<view class="u-text-center" @click="handleShare">
				<nmr-icon name="fenxiang-4" size="34" color="#666666"></nmr-icon>
				<view>分享</view>
			</view>
		</view>
		<view class="supplier-type" v-if="info.platformGoodsSpecMix[0].supplierName" :class="[!info.platformGoodsSpecMix[0].supplierName ? 'zy-class' : 'pop-class']">
			{{ info.platformGoodsSpecMix[0].supplierName ? info.platformGoodsSpecMix[0].supplierName : "自营" }}
		</view>
		<!-- 	<view class="df aic jcsb">
			<view class="price u-skeleton-fillet df " v-if="TOKEN">
				<text class="fs24">￥</text><text>{{info&&info.priceRange||''}}</text>
			</view>
			<view class="price u-skeleton-fillet df " v-else>
				<text>登录可见价格</text>
			</view>
		</view> -->
		<!-- <view class="type-tag" >
			易解冻
		</view> -->

		<view class="specName" v-if="info.introduce">
			{{ info.introduce || "" }}
		</view>
		<!-- <view class="c6 fs24 mt20" v-if="info.introduce">
			{{info.introduce}}
		</view> -->
		<view class="df aic jcsb mt20">
			<!-- <view class="price1">
			</view> -->
			<view class="price1 u-skeleton-fillet df" v-if="TOKEN">
				<!-- <view class="fs24" v-if="TOKEN">￥</view> -->
				<!-- 如果没有库存的且报价时间已失效 价格显示待报价 -->
				<!-- {{info.end,info.platformGoodsSpecMix[0].stock}} -->
				<view class="df aic" v-if="source == 'theme'">
					<Vip class="mr5" v-if="
              info.priceRangeOne &&
              TOKEN &&
              $common.calcTime(info.startTime, info.endTime)
            ">
					</Vip>
					<view class="price">
						
						<text><text class="fs24">￥</text>{{
                !info.end &&
                (info.platformGoodsSpecMix[0].stock <=0)
                  ? "待报价"
                  : (info && info.priceRange) || ""
              }}</text>
					</view>
					<view class="df aic cEF2929 ml20" v-if="
              info.platformGoodsSpecMix[0].referencePrice &&
              info.platformGoodsSpecMix[0].referencePrice != '0.00' &&
             ! (!info.end ||
                info.platformGoodsSpecMix[0].stock<=0)
            ">
						<text class="fs24">单价：</text><text
							class="fs40">{{ info.platformGoodsSpecMix[0].referencePrice }}元/{{
                info.platformGoodsSpecMix[0].referenceUnit
              }}</text>
					</view>
				</view>
				<template v-else>
					<view class="df aic">
						<Vip class="mr5" v-if="
                info.priceRangeOne &&
                TOKEN &&
                $common.calcTime(info.startTime, info.endTime)
              "></Vip>
						<view class="price"><text class="fs24">￥ </text>{{
                $common.calcTime(info.startTime, info.endTime) || info.source
                  ? info.priceRange || 0
                  : "待报价"
              }}
						</view>
						<view class="df aic cEF2929 ml20" v-if="
                info.referencePriceRange &&
                info.referencePriceRange != '0.00' &&
                info.end &&
                info.platformGoodsSpecMix.length == 1
              ">
							<text class="fs24">单价：</text>
							<text class="fs40">{{ info.referencePriceRange }}</text>
						</view>
					</view>
				</template>
			</view>
			<view class="price u-skeleton-fillet df" v-else>
				<text>登录可见价格</text>
			</view>
			<view class="fs24">
				<text class="c6">销量:</text> <text class="c3">{{ info.saleNum }}</text>
			</view>
		</view>
		<view class="df aic cEF2929 fwb" v-if="
        info.referencePriceRange &&
        info.referencePriceRange != '0.00' &&
        info.end &&
        info.platformGoodsSpecMix.length != 1 &&
        TOKEN
      ">
			<text class="fs24">单价：</text>
			<text class="fs40">{{ info.referencePriceRange }}</text>
		</view>
		<view class="df aic mt10">
			<!-- <view class="type-tag" >
				易解冻
			</view> -->
			<!-- <view class="price fs24" v-if="info.isOpen == 1 && info.startTime">
				报价有效期截至: {{ info.startTime }} ~ {{ info.endTime }}
			</view> -->
		</view>
		<view class="df aic jcsb mt20">
			<view class="">
				<nmr-icon name="pingtaidanbaodanbao" size="34" color="#48A147"></nmr-icon>
				<text class="c48A147 fs24 ml12 fw6">实地认证</text>
			</view>
			<view class="">
				<nmr-icon name="renzheng1" size="34" color="#48A147"></nmr-icon>
				<text class="c48A147 fs24 ml12 fw6">担保交易</text>
			</view>
			<view class="">
				<nmr-icon name="zukeshipai" size="34" color="#48A147"></nmr-icon>
				<text class="c48A147 fs24 ml12 fw6">货品实拍</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ["info", "currentSpecName", "source"],
		components: {},
		data() {
			return {
				tagList: [{
						name: "品质甄选",
						icon: "pinzhi",
					},
					{
						name: "新鲜保质",
						icon: "pinzhi",
					},
					{
						name: "售后无忧",
						icon: "pinzhi",
					},
				],
			};
		},
		methods: {
			handleShare() {
				this.$emit("handleShare");
			},
		},
	};
</script>

<style lang="scss" scoped>
	.type-tag {
		padding: 3rpx 10rpx;
		background: #f0fff0;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		opacity: 1;
		border: 1rpx solid #48a147;
		font-size: 22rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		color: #48a147;
		display: inline-block;
		margin-top: 12rpx;
	}

	.specName {
		font-size: 24rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #666666;
		margin-top: 10rpx;
	}

	.box {
		border-radius: 20rpx;
		margin: 20rpx 30rpx;
		background-color: white;
		font-size: 24rpx;
		font-family: PingFangSC-Regular-, PingFangSC-Regular;
		font-weight: normal;

		.price1 {
			font-size: 36rpx;
			font-family: PingFangSC-Semibold-, PingFangSC-Semibold;
			font-weight: normal;
			color: #333333;
			align-items: flex-end;
		}

		.desc {
			font-size: 24rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #666666;
		}

		.title {
			font-size: 28rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			color: #333333;
		}

		.tag-box {
			font-size: 24rpx;
			font-family: PingFangSC-Medium-, PingFangSC-Medium;
			font-weight: normal;
			color: #47a848;
		}
	}

	.tag-name {
		background: #ef2929;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 2rpx 15rpx;
		font-size: 22rpx;
		color: white;
	}

	.tag-price {
		background: #ffcc09;
	}

	.fs50 {
		font-size: 50rpx;
	}

	.cEF2929 {
		color: #ef2929;
	}

	.supplier-type {
		padding: 1rpx 10rpx;
		font-size: 22rpx;
		color: white;
		margin-right: 10rpx;
		border-radius: 16rpx;
		display: inline-block;
	}

	.zy-class {
		background-color: #48a147;
	}

	.pop-class {
		background-color: #999999;
	}
</style>